<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Resolver Class Reference</title>
    <link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
    <link rel="stylesheet" type="text/css" href="../css/highlight.css" />
    <meta charset='utf-8'>
    <script src="../js/jquery.min.js" defer></script>
    <script src="../js/jazzy.js" defer></script>
    
  </head>
  <body>
    <a name="//apple_ref/swift/Class/Resolver" class="dashAnchor"></a>
    <a title="Resolver Class Reference"></a>
    <header>
      <div class="content-wrapper">
        <p><a href="../index.html"> Docs</a> (100% documented)</p>
      </div>
    </header>
    <div class="content-wrapper">
      <p id="breadcrumbs">
        <a href="../index.html"> Reference</a>
        <img id="carat" src="../img/carat.png" />
        Resolver Class Reference
      </p>
    </div>
    <div class="content-wrapper">
      <nav class="sidebar">
        <ul class="nav-groups">
          <li class="nav-group-name">
            <a href="../Classes.html">Classes</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../Classes/Resolver.html">Resolver</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/ResolverOptions.html">ResolverOptions</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/ResolverRegistration.html">ResolverRegistration</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/ResolverScopeApplication.html">ResolverScopeApplication</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/ResolverScopeCache.html">ResolverScopeCache</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/ResolverScopeGraph.html">ResolverScopeGraph</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/ResolverScopeShare.html">ResolverScopeShare</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/ResolverScopeUnique.html">ResolverScopeUnique</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a href="../Extensions.html">Extensions</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../Extensions/UIViewController.html">UIViewController</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a href="../Protocols.html">Protocols</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../Protocols/ResolverRegistering.html">ResolverRegistering</a>
              </li>
              <li class="nav-group-task">
                <a href="../Protocols/ResolverScope.html">ResolverScope</a>
              </li>
              <li class="nav-group-task">
                <a href="../Protocols/Resolving.html">Resolving</a>
              </li>
              <li class="nav-group-task">
                <a href="../Protocols/StoryboardResolving.html">StoryboardResolving</a>
              </li>
            </ul>
          </li>
        </ul>
      </nav>
      <article class="main-content">
        <section>
          <section class="section">
            <h1>Resolver</h1>
              <div class="declaration">
                <div class="language">
                  <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">final</span> <span class="kd">class</span> <span class="kt">Resolver</span></code></pre>

                </div>
              </div>
            <p>Resolver is a Dependency Injection registry that registers Services for later resolution and
injection into newly constructed instances.</p>

          </section>
          <section class="section task-group-section">
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Defaults"></a>
                <a name="//apple_ref/swift/Section/Defaults" class="dashAnchor"></a>
                <a href="#/Defaults">
                  <h3 class="section-name">Defaults</h3>
                </a>
              </div>
              <ul>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:8ResolverAAC4mainABvZ"></a>
                    <a name="//apple_ref/swift/Variable/main" class="dashAnchor"></a>
                    <a class="token" href="#/s:8ResolverAAC4mainABvZ">main</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Default registry used by the static Registration functions.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="k">let</span> <span class="nv">main</span><span class="p">:</span> <span class="kt">Resolver</span> <span class="o">=</span> <span class="kt">Resolver</span><span class="p">()</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:8ResolverAAC4rootABvZ"></a>
                    <a name="//apple_ref/swift/Variable/root" class="dashAnchor"></a>
                    <a class="token" href="#/s:8ResolverAAC4rootABvZ">root</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Default registry used by the static Resolution functions and by the Resolving protocol.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="k">var</span> <span class="nv">root</span><span class="p">:</span> <span class="kt">Resolver</span> <span class="o">=</span> <span class="n"><a href="../Classes/Resolver.html#/s:8ResolverAAC4mainABvZ">main</a></span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:8ResolverAAC12defaultScopeAA0aC5GraphCvZ"></a>
                    <a name="//apple_ref/swift/Variable/defaultScope" class="dashAnchor"></a>
                    <a class="token" href="#/s:8ResolverAAC12defaultScopeAA0aC5GraphCvZ">defaultScope</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Default scope applied when registering new objects.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="k">var</span> <span class="nv">defaultScope</span> <span class="o">=</span> <span class="kt">Resolver</span><span class="o">.</span><span class="n"><a href="../Classes/Resolver.html#/s:8ResolverAAC5graphAA0A10ScopeGraphCvZ">graph</a></span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Lifecycle"></a>
                <a name="//apple_ref/swift/Section/Lifecycle" class="dashAnchor"></a>
                <a href="#/Lifecycle">
                  <h3 class="section-name">Lifecycle</h3>
                </a>
              </div>
              <ul>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:8ResolverAACA2BSg6parent_tcfc"></a>
                    <a name="//apple_ref/swift/Method/init(parent:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:8ResolverAACA2BSg6parent_tcfc">init(parent:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">parent</span><span class="p">:</span> <span class="kt">Resolver</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:8ResolverAAC16registerServicesyyF"></a>
                    <a name="//apple_ref/swift/Method/registerServices()" class="dashAnchor"></a>
                    <a class="token" href="#/s:8ResolverAAC16registerServicesyyF">registerServices()</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Called by the Resolution functions to perform one-time initialization of the Resolver registries.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">final</span> <span class="kd">func</span> <span class="nf">registerServices</span><span class="p">()</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Service%20Registration"></a>
                <a name="//apple_ref/swift/Section/Service Registration" class="dashAnchor"></a>
                <a href="#/Service%20Registration">
                  <h3 class="section-name">Service Registration</h3>
                </a>
              </div>
              <ul>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:8ResolverAAC8registerAA0A7OptionsCyxGxm_SSSg4namexSgyc7factorytlFZ"></a>
                    <a name="//apple_ref/swift/Method/register(_:name:factory:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:8ResolverAAC8registerAA0A7OptionsCyxGxm_SSSg4namexSgyc7factorytlFZ">register(_:name:factory:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Static shortcut function used to register a specifc Service type and its instantiating factory method.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="n">register</span><span class="o">&lt;</span><span class="kt">Service</span><span class="o">&gt;</span><span class="p">(</span><span class="n">_</span> <span class="nv">type</span><span class="p">:</span> <span class="kt">Service</span><span class="o">.</span><span class="k">Type</span> <span class="o">=</span> <span class="kt">Service</span><span class="o">.</span><span class="k">self</span><span class="p">,</span> <span class="nv">name</span><span class="p">:</span> <span class="kt">String</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span>
                                     <span class="nv">factory</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="kt">ResolverFactory</span><span class="o">&lt;</span><span class="kt">Service</span><span class="o">&gt;</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt"><a href="../Classes/ResolverOptions.html">ResolverOptions</a></span><span class="o">&lt;</span><span class="kt">Service</span><span class="o">&gt;</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>type</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Type of Service being registered. Optional, may be inferred by factory result type.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>name</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Named variant of Service being registered.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>factory</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Closure that constructs and returns instances of the Service.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>ResolverOptions instance that allows further customization of registered Service.</p>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:8ResolverAAC8registerAA0A7OptionsCyxGxm_SSSg4namexSgAB_ypSgtc7factorytlFZ"></a>
                    <a name="//apple_ref/swift/Method/register(_:name:factory:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:8ResolverAAC8registerAA0A7OptionsCyxGxm_SSSg4namexSgAB_ypSgtc7factorytlFZ">register(_:name:factory:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Static shortcut function used to register a specifc Service type and its instantiating factory method.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="n">register</span><span class="o">&lt;</span><span class="kt">Service</span><span class="o">&gt;</span><span class="p">(</span><span class="n">_</span> <span class="nv">type</span><span class="p">:</span> <span class="kt">Service</span><span class="o">.</span><span class="k">Type</span> <span class="o">=</span> <span class="kt">Service</span><span class="o">.</span><span class="k">self</span><span class="p">,</span> <span class="nv">name</span><span class="p">:</span> <span class="kt">String</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span>
                                     <span class="nv">factory</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="kt">ResolverFactoryArguments</span><span class="o">&lt;</span><span class="kt">Service</span><span class="o">&gt;</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt"><a href="../Classes/ResolverOptions.html">ResolverOptions</a></span><span class="o">&lt;</span><span class="kt">Service</span><span class="o">&gt;</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>type</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Type of Service being registered. Optional, may be inferred by factory result type.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>name</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Named variant of Service being registered.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>factory</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Closure that accepts arguments and constructs and returns instances of the Service.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>ResolverOptions instance that allows further customization of registered Service.</p>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:8ResolverAAC8registerAA0A7OptionsCyxGxm_SSSg4namexSgyc7factorytlF"></a>
                    <a name="//apple_ref/swift/Method/register(_:name:factory:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:8ResolverAAC8registerAA0A7OptionsCyxGxm_SSSg4namexSgyc7factorytlF">register(_:name:factory:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Registers a specifc Service type and its instantiating factory method.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">final</span> <span class="kd">func</span> <span class="n">register</span><span class="o">&lt;</span><span class="kt">Service</span><span class="o">&gt;</span><span class="p">(</span><span class="n">_</span> <span class="nv">type</span><span class="p">:</span> <span class="kt">Service</span><span class="o">.</span><span class="k">Type</span> <span class="o">=</span> <span class="kt">Service</span><span class="o">.</span><span class="k">self</span><span class="p">,</span> <span class="nv">name</span><span class="p">:</span> <span class="kt">String</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span>
                                    <span class="nv">factory</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="kt">ResolverFactory</span><span class="o">&lt;</span><span class="kt">Service</span><span class="o">&gt;</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt"><a href="../Classes/ResolverOptions.html">ResolverOptions</a></span><span class="o">&lt;</span><span class="kt">Service</span><span class="o">&gt;</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>type</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Type of Service being registered. Optional, may be inferred by factory result type.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>name</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Named variant of Service being registered.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>factory</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Closure that constructs and returns instances of the Service.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>ResolverOptions instance that allows further customization of registered Service.</p>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:8ResolverAAC8registerAA0A7OptionsCyxGxm_SSSg4namexSgAB_ypSgtc7factorytlF"></a>
                    <a name="//apple_ref/swift/Method/register(_:name:factory:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:8ResolverAAC8registerAA0A7OptionsCyxGxm_SSSg4namexSgAB_ypSgtc7factorytlF">register(_:name:factory:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Registers a specifc Service type and its instantiating factory method.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">final</span> <span class="kd">func</span> <span class="n">register</span><span class="o">&lt;</span><span class="kt">Service</span><span class="o">&gt;</span><span class="p">(</span><span class="n">_</span> <span class="nv">type</span><span class="p">:</span> <span class="kt">Service</span><span class="o">.</span><span class="k">Type</span> <span class="o">=</span> <span class="kt">Service</span><span class="o">.</span><span class="k">self</span><span class="p">,</span> <span class="nv">name</span><span class="p">:</span> <span class="kt">String</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span>
                                    <span class="nv">factory</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="kt">ResolverFactoryArguments</span><span class="o">&lt;</span><span class="kt">Service</span><span class="o">&gt;</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt"><a href="../Classes/ResolverOptions.html">ResolverOptions</a></span><span class="o">&lt;</span><span class="kt">Service</span><span class="o">&gt;</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>type</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Type of Service being registered. Optional, may be inferred by factory result type.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>name</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Named variant of Service being registered.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>factory</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Closure that accepts arguments and constructs and returns instances of the Service.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>ResolverOptions instance that allows further customization of registered Service.</p>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Service%20Resolution"></a>
                <a name="//apple_ref/swift/Section/Service Resolution" class="dashAnchor"></a>
                <a href="#/Service%20Resolution">
                  <h3 class="section-name">Service Resolution</h3>
                </a>
              </div>
              <ul>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:8ResolverAAC7resolvexxm_SSSg4nameypSg4argstlF"></a>
                    <a name="//apple_ref/swift/Method/resolve(_:name:args:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:8ResolverAAC7resolvexxm_SSSg4nameypSg4argstlF">resolve(_:name:args:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Resolves and returns an instance of the given Service type from the current registry or from its
parent registries.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">final</span> <span class="kd">func</span> <span class="n">resolve</span><span class="o">&lt;</span><span class="kt">Service</span><span class="o">&gt;</span><span class="p">(</span><span class="n">_</span> <span class="nv">type</span><span class="p">:</span> <span class="kt">Service</span><span class="o">.</span><span class="k">Type</span> <span class="o">=</span> <span class="kt">Service</span><span class="o">.</span><span class="k">self</span><span class="p">,</span> <span class="nv">name</span><span class="p">:</span> <span class="kt">String</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span> <span class="nv">args</span><span class="p">:</span> <span class="kt">Any</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Service</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>type</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Type of Service being resolved. Optional, may be inferred by assignment result type.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>name</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Named variant of Service being resolved.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>args</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Optional arguments that may be passed to registration factory.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>Instance of specified Service.</p>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:8ResolverAAC8optionalxSgxm_SSSg4nameypSg4argstlF"></a>
                    <a name="//apple_ref/swift/Method/optional(_:name:args:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:8ResolverAAC8optionalxSgxm_SSSg4nameypSg4argstlF">optional(_:name:args:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Resolves and returns an optional instance of the given Service type from the current registry or
from its parent registries.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">final</span> <span class="kd">func</span> <span class="kd">optional</span><span class="o">&lt;</span><span class="kt">Service</span><span class="o">&gt;</span><span class="p">(</span><span class="n">_</span> <span class="nv">type</span><span class="p">:</span> <span class="kt">Service</span><span class="o">.</span><span class="k">Type</span> <span class="o">=</span> <span class="kt">Service</span><span class="o">.</span><span class="k">self</span><span class="p">,</span> <span class="nv">name</span><span class="p">:</span> <span class="kt">String</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span> <span class="nv">args</span><span class="p">:</span> <span class="kt">Any</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Service</span><span class="p">?</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>type</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Type of Service being resolved. Optional, may be inferred by assignment result type.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>name</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Named variant of Service being resolved.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>args</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Optional arguments that may be passed to registration factory.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>Instance of specified Service.</p>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Scopes"></a>
                <a name="//apple_ref/swift/Section/Scopes" class="dashAnchor"></a>
                <a href="#/Scopes">
                  <h3 class="section-name">Scopes</h3>
                </a>
              </div>
              <ul>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:8ResolverAAC11applicationAA0A16ScopeApplicationCvZ"></a>
                    <a name="//apple_ref/swift/Variable/application" class="dashAnchor"></a>
                    <a class="token" href="#/s:8ResolverAAC11applicationAA0A16ScopeApplicationCvZ">application</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="k">let</span> <span class="nv">application</span> <span class="o">=</span> <span class="kt"><a href="../Classes/ResolverScopeApplication.html">ResolverScopeApplication</a></span><span class="p">()</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:8ResolverAAC6cachedAA0A10ScopeCacheCvZ"></a>
                    <a name="//apple_ref/swift/Variable/cached" class="dashAnchor"></a>
                    <a class="token" href="#/s:8ResolverAAC6cachedAA0A10ScopeCacheCvZ">cached</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="k">let</span> <span class="nv">cached</span> <span class="o">=</span> <span class="kt"><a href="../Classes/ResolverScopeCache.html">ResolverScopeCache</a></span><span class="p">()</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:8ResolverAAC5graphAA0A10ScopeGraphCvZ"></a>
                    <a name="//apple_ref/swift/Variable/graph" class="dashAnchor"></a>
                    <a class="token" href="#/s:8ResolverAAC5graphAA0A10ScopeGraphCvZ">graph</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="k">let</span> <span class="nv">graph</span> <span class="o">=</span> <span class="kt"><a href="../Classes/ResolverScopeGraph.html">ResolverScopeGraph</a></span><span class="p">()</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:8ResolverAAC6sharedAA0A10ScopeShareCvZ"></a>
                    <a name="//apple_ref/swift/Variable/shared" class="dashAnchor"></a>
                    <a class="token" href="#/s:8ResolverAAC6sharedAA0A10ScopeShareCvZ">shared</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="k">let</span> <span class="nv">shared</span> <span class="o">=</span> <span class="kt"><a href="../Classes/ResolverScopeShare.html">ResolverScopeShare</a></span><span class="p">()</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:8ResolverAAC6uniqueAA0A11ScopeUniqueCvZ"></a>
                    <a name="//apple_ref/swift/Variable/unique" class="dashAnchor"></a>
                    <a class="token" href="#/s:8ResolverAAC6uniqueAA0A11ScopeUniqueCvZ">unique</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="k">let</span> <span class="nv">unique</span> <span class="o">=</span> <span class="kt"><a href="../Classes/ResolverScopeUnique.html">ResolverScopeUnique</a></span><span class="p">()</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
          </section>
        </section>
        <section id="footer">
          <p>&copy; 2018 <a class="link" href="" target="_blank" rel="external"></a>. All rights reserved. (Last updated: 2018-03-14)</p>
          <p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
        </section>
      </article>
    </div>
  </body>
</div>
</html>
